﻿Imports AccesoDatos
Public Class CatalogoPersona

    Public Function ObtenerUsuario(ByVal pstrUsuario As String, ByVal pstrClave As String) As DataSet

        Dim dsConsultaDatos As DataSet
        Dim objCom As New BaseDatos
        Dim Parametros(,) As Object = {{"@USUARIO", SqlDbType.VarChar, UCase(pstrUsuario)}, _
                                        {"@CLAVE", SqlDbType.VarChar, UCase(pstrClave)}}
        dsConsultaDatos = objCom.ExecSPDataSetCP("SP_Login", Parametros)
        
        Return dsConsultaDatos
    End Function


    'Public Function ObtenerUsuarioSistema(ByVal pstrUsuario As String) As DataSet

    '    Dim dsConsultaDatos As DataSet
    '    Dim objCom As New BaseDatos
    '    Dim Parametros(,) As Object = {{"@USUARIO", SqlDbType.VarChar, UCase(pstrUsuario)}}
    '    dsConsultaDatos = objCom.ExecSPDataSetCP("DT_LoginSistema", Parametros)
    '    Return dsConsultaDatos

    'End Function

    Public Function ObtenerCboSistema(ByVal pstrUsuario As String) As DataSet

        Dim dsConsultaDatos As DataSet
        Dim objCom As New BaseDatos
        Dim Parametros(,) As Object = {{"@USUARIO", SqlDbType.VarChar, UCase(pstrUsuario)}}
        dsConsultaDatos = objCom.ExecSPDataSetCP("SP_LOGIN_CBOSISTEMA", Parametros)
        Return dsConsultaDatos
    End Function

    Public Function ObtenerCboRol(ByVal pstrUsuario As String, ByVal pstrSistema As String) As DataSet
        Dim dsConsultaDatos As DataSet
        Dim objCom As New BaseDatos
        Dim Parametros(,) As Object = {{"@USUARIO", SqlDbType.VarChar, UCase(pstrUsuario)}, _
                                        {"@SISTEMA", SqlDbType.VarChar, UCase(pstrSistema)}}
        dsConsultaDatos = objCom.ExecSPDataSetCP("SP_LOGIN_CBOROL", Parametros)
        Return dsConsultaDatos
    End Function

    Public Function ObtenerCboLocal(ByVal pstrUsuario As String, ByVal pstrSistema As String, ByVal pstrRol As String) As DataSet
        Dim dsConsultaDatos As DataSet
        Dim objCom As New BaseDatos
        Dim Parametros(,) As Object = {{"@USUARIO", SqlDbType.VarChar, UCase(pstrUsuario)}, _
                                        {"@SISTEMA", SqlDbType.VarChar, UCase(pstrSistema)}, _
                                        {"@ROL", SqlDbType.VarChar, UCase(pstrRol)}}
        dsConsultaDatos = objCom.ExecSPDataSetCP("SP_LOGIN_CBOLOCAL", Parametros)
        Return dsConsultaDatos
    End Function


    'Public Function ObtenerJefeUnidad(ByVal pstrCia As String, ByVal pstrCodigo As String, ByVal pstrOficina As String, ByVal pstrUnidad As String) As DataSet

    '    Dim dsConsultaDatos As DataSet
    '    Dim objCom As New BaseDatos
    '    Dim Parametros(,) As Object = {{"@CIA", SqlDbType.VarChar, UCase(pstrCia)}, _
    '                                    {"@CODIGO", SqlDbType.VarChar, UCase(pstrCodigo)}, _
    '                                    {"@OFICINA", SqlDbType.VarChar, UCase(pstrOficina)}, _
    '                                    {"@UNIDAD", SqlDbType.VarChar, UCase(pstrUnidad)}}
    '    dsConsultaDatos = objCom.ExecSPDataSetCP("PRE_LISTAUNIDADUSUARIO", Parametros)
    '    Return dsConsultaDatos

    'End Function


    '***************************************
    'APLICACION MOVIL
    '***************************************
    Public Function ObtenerUsuarioMobile(ByVal pstrUsuario As String, ByVal pstrClave As String) As DataSet
        Dim dsConsultaDatos As DataSet
        Dim objCom As New BaseDatos
        Dim Parametros(,) As Object = {{"@USUARIO", SqlDbType.VarChar, UCase(pstrUsuario)}, _
                                        {"@CLAVE", SqlDbType.VarChar, UCase(pstrClave)}}
        dsConsultaDatos = objCom.ExecSPDataSetCP("SP_Login_MOBILE", Parametros)

        Return dsConsultaDatos
    End Function


End Class
